package com.shiyi.shiyiaiagent.controller;

import com.shiyi.shiyiaiagent.app.LoveApp;
import com.shiyi.shiyiaiagent.chatMemory.entity.ChatMessage;
import com.shiyi.shiyiaiagent.service.ChatMessagesService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.UUID;

@RestController
@RequestMapping("/health")
public class HealthController {

  @Resource
  private LoveApp loveApp;

  @Resource
  private ChatMessagesService chatMessagesService;
  @GetMapping
  public String health() {
    return "OK";
  }


  @PostMapping("/test")
  public void test(){
//    String chatId = UUID.randomUUID().toString();
//    //第一轮
//    String answer = loveApp.doChat("你好我是十一", chatId);
//
//
//    //第二轮
//    answer = loveApp.doChat("我想让我的另一半（小x）更爱我", chatId);
//
//    //第三轮
//    answer = loveApp.doChat("我刚刚说我的另一半是谁来着", chatId);

    List<ChatMessage> list = chatMessagesService.list();
  }

}
